<template>
    <ul class="news-list">
        <li>编号: {{ query.id }}</li>
        <li>标题: {{ query.title }}</li>
        <li>内容: {{ query.content }}</li>
    </ul>
</template>
<script lang="ts">
export default {
    name: 'Detail',
}
</script>
<script lang="ts" setup>
import { toRefs } from 'vue'
import { useRoute } from 'vue-router'
let route = useRoute()
// 必须用toRefs, 从一个响应式对象解构出来的属性会丢失响应特性
let { query } = toRefs(route)
</script>
<style scoped>
.news-list {
    list-style: none;
    padding-left: 20px;
}

.news-list>li {
    line-height: 30px;
}
</style>